<template>
    <div>
      <el-form :model="adminForm" :rules="rules" ref="adminFormRules" label-width="200px" >
  <el-form-item label="用户名" prop="username">
    <el-input v-model="adminForm.username"></el-input>
  </el-form-item></el-form>
  <el-button @click="aa">测试</el-button>
    </div>
  </template>
  
  <script>
  import isValid  from '@/js/isValid';
  export default {
  methods:{
    aa(){
      // isValid.isvalidPass(this.adminForm.username)
      this.$fromCheck.usernameCheck()
    }
  },
  data(){
    return{
      adminForm: {
          username: '',},
          rules: {
            username: [
         { required: true, validator:this.$fromCheck.usernameCheck, trigger: 'blur' },
          {
            min: 3,max: 10,message: '长度在 3 到 10 个字符',trigger: 'blur',
          },
        ],}
    }
  }
  }
  </script >
  
  <style scoped>
  div{
    width: 1130px;
    height: 500px;
    margin-top: 50px;
    margin-left: 20px;
    background-color: aqua;
  }
  </style>